Who is Nvidia ? Nvidia is a tech company that specialises in graphics processing and artificial intelligence. Since being founded in 1993, it has played a huge role in developing gaming technology, AI research, and high-performance computing, influencing a wide range of industries.
I have been interested in Nvidia for some time, particularly because of its role in shaping the future of AI and high-performance computing. During my placement at Mercedes-Benz Financial Services, I developed an interest in investing and began analysing market trends more closely. Nvidia stood out as a company that has consistently driven innovation, especially with its Blackwell architecture, which has made its GPUs significantly more powerful and efficient for AI applications.
Beyond just stock performance, this time series reflects how technological advancements influence financial markets. Analysing Nvidia’s stock allows me to explore the intersection of AI, investing, and market trends, reinforcing my passion for both technology and financial analysis.
To understand why it’s beneficial we need to look at how stock prices behave and why they matter to investors.
The stock is highly volatile, driven by advancements in AI hardware, market demand and broader economic conditions. So modelling it’s price movement can help investors identify trends and make more informed decisions about buying/selling. By analysing historical data, investors can gain an insight into patterns that indicate potential growth or risk. A well-structured model can help investors manage risk, navigate uncertainty and take advantage of opportunities in this rapidly evolving industry.
Source: Yahoo Finance
Date Range: 01/01/2020 - 31/12/2024
Frequency: Daily
## Loading required package: Rcpp
## Loading required package: rlang
This reads the Nvidia stock price data from a CSV file
# Convert the Date column to Date object
nvda_raw$Date <- as.Date(nvda_raw$Date, format = "%d/%m/%Y")
nvda_df <- data.frame(
ds = zoo::as.yearmon(nvda_raw$Date),
y = nvda_raw$Close
)This converts the time series for Nvidia into a dataframe
## ds y
## 1 Jan 2020 5.99775
## 2 Jan 2020 5.90175
## 3 Jan 2020 5.92650
## 4 Jan 2020 5.99825
## 5 Jan 2020 6.00950
## 6 Jan 2020 6.07550
To check if R has interpreted the data correctly we can use head() to check the first 6 lines are printed
Our aim is to use past data from Nvidia’s performance to help us track the future performance of the stock in 2025.This analysis will help to identify the prophet model’s strengths and limitations. It will give a clearer understanding of the uncertainty inherent in the predictions. In the end, this evaluation will show whether further refinements are needed for more reliable investment decision-making.
The Prophet software is a time series forecasting tool that has been created by Facebook (Meta) that essentially makes predicting future trends easy. It breaks down data into 3 parts: trends that capture long-term patterns, seasonality that accounts for recurring cycles for example weekly/ yearly trends and any external effects such as holidays that can impact the data.
Formula:
\(y(t) = g(t) + s(t) + h(t) + \epsilon_t\)
where:
First we apply decomposition by breaking down Nvidia’s stock price into it’s trend, seasonality and residual components to better understand the patterns. After we’ve analysed the factors, we apply the Prophet model to forecast the stock prices for the next eight quarters. This essentially involves structuring the data, building a forecast and then visuaising the historical trends and the future predictions. We then examine Prophet’s breakdown of key components before concluding with a linear regression analysis to assess the overall growth and reliability of the forecast.
Observed: This shows the actual stock price over time. Nvidia’s stock has generally been rising, but there are clear periods of volatility, likely influenced by market trends, product launches and investor sentiment.
Trend: The trend line highlights the overall direction of Nvidia’s stock. There is a steady upward movement, with sharp increases at certain points. This could be linked to key events, such as the release of new GPUs or growth in AI-driven demand.
Seasonality: The seasonality component reveals short term, repeating patterns. These fluctuations might be tied to quarterly earnings reports, product launches or other regular market events. Unlike traditional seasonal trends in industries like retail, stock market seasonality is often shaped by investor behaviour.
Residual (Random Noise): This captures what is left after removing the trend and seasonality. The later periods show higher fluctuations, suggesting that Nvidia’s stock has become more unpredictable, possibly due to external economic factors or shifting investor confidence.
⚠️ Important Considerations
Before we begin our analysis, REMEMBER that Prophet assumes past patterns will continue into the future. However, unexpected market shocks can disrupt these trends.
The forecast should be interpreted with confidence intervals to assess uncertainty
library(prophet)
model = prophet(nvda_df)
Futuredataframe = make_future_dataframe(model, periods = 8, freq = "quarter")In this code, I first load the Prophet library then fit the Prophet model on the dataset. Then extend the timeline by 8 quarters so that it can generate new forecastss for future dates.
Lastly, using the predict() function i generated the forecasts and plotted a visual of the dataset
Remember:
ds = Year
y = Price
This graph basically shows the forecast of Nvidia’s stock price as modelled by Prophet model. It’s divided into three main parts:
Historical Data (Black Dots): These represent the actual stock prices recorded from 2020 to 2024.
Forecast (Blue Line): This line shows the predicted trend for Nvidia’s stock, extending eight quarters into the future.
Uncertainty Intervals (Shaded Area): The shaded area around the blue line reflects the uncertainty in the forecast. As the forecast moves further into the future, the uncertainty becomes larger.
Overall, the graph provides a clear picture of past performance and offers an insight into future expectations as well as some uncertainty levels.
The trend shows that Nvidia’s stock stayed fairly steady until 2023, then started rising sharply.
The seasonality suggests a pattern where stock prices tend to rise around mid-year and dip towards October, possibly due to earnings reports or market trends. While the model picks up on key movements, it’s important to be cautious as stock prices can be unpredictable.
##
## Call:
## lm(formula = Close ~ time_index, data = nvda_raw)
##
## Residuals:
## Min 1Q Median 3Q Max
## -35.209 -19.773 1.587 13.980 59.822
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.091e+03 2.278e+01 -47.9 <2e-16 ***
## time_index 5.890e-02 1.187e-03 49.6 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 22.18 on 1255 degrees of freedom
## Multiple R-squared: 0.6622, Adjusted R-squared: 0.662
## F-statistic: 2461 on 1 and 1255 DF, p-value: < 2.2e-16
From the summary produced, we can extract the following key insights:
Nvidia’s stock price increases by 0.0589 per time unit on average.
standard error is 0.001187, which is very low, indicating a highly precise estimate
p-value <2e-16 is much smaller than 0.05, meaning the trend is statistically significant, and time has a strong impact on stock price
The R-squared value of 0.6622 means that time explains approx 66% of the changes in Nvidia’s stock price, suggesting taht there’s a strong correlation.
library(dygraphs)
dyplot.prophet(model, predictions, xlab = "Years", ylab = "Nvidia Stock Price (USD)")## Warning: `select_()` was deprecated in dplyr 0.7.0.
## ℹ Please use `select()` instead.
## ℹ The deprecated feature was likely used in the prophet package.
## Please report the issue at <https://github.com/facebook/prophet/issues>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
This is a more interactive plot that can be used to dive deeper into historical data and future predictions. If you hover over the black dots then a small box will appear in the top right corner that includes the date, actual price and the predicted price of the stock. Looking at the plot, the blue forecast line follows the overall trend pretty well, but it doesn’t quite capture the short-term ups and downs of the actual stock prices. This makes sense because Prophet is designed to smooth out fluctuations, so it might overestimate or underestimate certain price movements.
The candlestick chart gives a clear view of how Nvidia’s stock has moved over the last 30 days. Each candlestick represents a trading day, showing whether the price went up or down. Green candles mean the stock closed higher than it opened, showing buyers were in control, while red candles mean it closed lower, suggesting sellers had the upper hand. The thin lines above and below the candles show how much the price moved during the day, with longer wicks meaning higher volatility.
Looking at the trend, Nvidia’s stock started strong with a steady rise, but then faced a sharp decline, with multiple red candles appearing. This suggests a period of selling pressure, possibly due to external market factors or investor reactions. Towards the end of the period, we see signs of recovery, as more green candles appear, indicating potential buying interest. This chart helps identify trends, reversals and key price levels, giving a better sense of Nvidia’s recent market behaviour.